<template>
    <div>
        <div class="game-main k3 left">
            <div class="betTitle">
                <div class="betLogo">
                    <h2>江苏快3</h2>
                    <i class="game-logo icon_js_ks"></i>
                </div>
                <countTime />
                <div class="announced" id="Results">
                    <div class="announced-tab">
                        <div id="first" class="tab-item active">
                            <span>近一期</span>
                        </div>
                        <div id="recent" class="tab-item">
                            <span>近五期</span>
                        </div>
                    </div>
                    <div class="his-wrapper" style="display: none;">
                        <ul class="his-list">
                            <li class="his-item">第20180916018期<span class="ball">2</span><span class="ball">5</span><span class="ball">6</span></li>
                            <li class="his-item">第20180916017期<span class="ball">2</span><span class="ball">4</span><span class="ball">6</span></li>
                            <li class="his-item">第20180916016期<span class="ball">5</span><span class="ball">5</span><span class="ball">6</span></li>
                            <li class="his-item">第20180916015期<span class="ball">1</span><span class="ball">5</span><span class="ball">6</span></li>
                            <li class="his-item">第20180916014期<span class="ball">1</span><span class="ball">3</span><span class="ball">6</span></li>
                        </ul>
                    </div>
                    <div class="cur-wrapper" style="display:block;">
                        <div class="announcedTitle">第<b>20180928053</b>期开奖号码：</div>
                        <ul class="announcedNo fix" id="num-loading">
                            <img width="61" height="71" src="https://066981.com/themes/simpleboot3/public/assets/images/open_num.gif">
                            <img width="61" height="71" src="https://066981.com/themes/simpleboot3/public/assets/images/open_num.gif">
                            <img width="61" height="71" src="https://066981.com/themes/simpleboot3/public/assets/images/open_num.gif">
                        </ul>
                        <ul class="announcedNo fix" id="num-opened" style="display: none">
                            <li class="announce"></li>
                            <li class="announce"></li>
                            <li class="announce"></li>
                        </ul>
                    </div>
                </div>
            </div>
            <!--金额控制-->
            <div class="sum-ctrl">
                <div class="sum-title">
                    <ul>
                        <li>整合</li>
                    </ul>
                </div>
                <div class="sun-con">
                    <Button v-for="item in manyCtrl" :key="item" style="margin-left:15px;" @click="changeSum(item)">{{item}}</Button>
                    <label>预设金额:<input type="number" v-model="sumMany"/></label>
                </div>
            </div>
            <!--下注列表-->
            <div class="bet">
                <Row>
                    <Col span="24" class="bet-list-tit">和值</Col>
                </Row>
                <Row class="bet-list-con">
                    <div class="s_col_20 td clear" v-for="(item,index) in arr" :key="index">
                            <div class="clear">
                                <Col class="rb-line" span="6">{{item.ntr}}</Col>
                                <Col class="rb-line" span="5">{{item.odds}}</Col>
                                <Col class="rb-line" span="13"><input type="number" number="true" class="ivu-input ivu-input-small" v-model="item.num" @click="payNum(index)" v-on:input ="inputFunc($event)" /></Col>
                            </div>
                    </div>
                </Row>
                <Row>
                    <Col span="24" class="bet-list-tit">两连</Col>
                </Row>
                <Row class="bet-list-con">
                    <div class="s_col_20 td clear" v-for="(item,index) in arr" :key="index">
                            <div class="clear">
                                <Col class="rb-line" span="6">{{item.ntr}}</Col>
                                <Col class="rb-line" span="5">{{item.odds}}</Col>
                                <Col class="rb-line" span="13"><input type="number" number="true" class="ivu-input ivu-input-small" v-model="item.num" v-on:input ="inputFunc($event)" /></Col>
                            </div>
                    </div>
                </Row>
                <Row>
                    <Col span="8" class="bet-list-tit">独胆</Col>
                    <Col span="8" class="bet-list-tit">豹子</Col>
                    <Col span="8" class="bet-list-tit">对子</Col>
                </Row>
                <Row class="bet-list-con">
                    <!--独胆-->
                    <Col span="8">
                        <div class="td clear" style="float:none;" v-for="(item,index) in arr" :key="index">
                                <div class="clear">
                                    <Col class="rb-line" span="6">1</Col>
                                    <Col class="rb-line" span="5">4.370</Col>
                                    <Col class="rb-line" span="13"><input type="number" number="true" class="ivu-input ivu-input-small" v-on:input ="inputFunc($event)" /></Col>
                                </div>
                        </div>
                    </Col>
                    <!--豹子-->
                    <Col span="8">
                        <div class="td clear" style="float:none;" v-for="(item,index) in arr" :key="index">
                                <div class="clear">
                                    <Col class="rb-line" span="6">1，1，1</Col>
                                    <Col class="rb-line" span="5">4.370</Col>
                                    <Col class="rb-line" span="13"><input type="number" number="true" class="ivu-input ivu-input-small" v-on:input ="inputFunc($event)" /></Col>
                                </div>
                        </div>
                    </Col>
                    <!--对子-->
                    <Col span="8">
                        <div class="td clear" style="float:none;" v-for="(item,index) in arr" :key="index">
                                <div class="clear">
                                    <Col class="rb-line" span="6">1，1</Col>
                                    <Col class="rb-line" span="5">4.370</Col>
                                    <Col class="rb-line" span="13"><input type="number" number="true" class="ivu-input ivu-input-small" v-on:input ="inputFunc($event)" /></Col>
                                </div>
                        </div>
                    </Col>
                </Row>
            </div>
            <!--下注按钮-->
            <div class="addOrderBox clear">
                <Button type="warning" @click="addBet">添加投注</Button>
                <Modal
                    v-model="modBet"
                    title="Common Modal dialog box title"
                    @on-ok="ok"
                    @on-cancel="cancel">
                    <p>是否确认购买</p>
                    <p>共{{total}}元</p>
                </Modal>
            </div>
            <lotteryHistory />
            <clientSide />
        </div>
        <!--右侧内容-->
        <div class="resultList left">
            <!--今日开奖-->
            <div class="title">
                <span>今日开奖</span>
                <div class="more">
                    <a target="_blank" href="/zst/79">走势图</a>
                    <a target="_blank" href="/introduce/79">玩法说明</a>
                </div>
            </div>
            <table width="100%" border="0" cellspacing="0" cellpadding="0" id="fn_getoPenGame" class="ty_table_gameBet curr">
                <thead>
                    <tr>
                    <th>期号</th>
                    <th>开奖号码</th>
                    <th>和值</th>
                    <th>形态</th></tr>
                </thead>
                <tbody>
                    <tr>
                    <td>20180916018</td>
                    <td>
                        <span class="numbers">2,5,6</span></td>
                    <td>13</td>
                    <td>
                        <em class="size blue">大</em>
                        <em class="dan blue">单</em></td>
                    </tr>
                    <tr>
                    <td>20180916017</td>
                    <td>
                        <span class="numbers">2,4,6</span></td>
                    <td>12</td>
                    <td>
                        <em class="size blue">大</em>
                        <em class="dan yellow">双</em></td>
                    </tr>
                    <tr>
                    <td>20180916016</td>
                    <td>
                        <span class="numbers">5,5,6</span></td>
                    <td>16</td>
                    <td>
                        <em class="size blue">大</em>
                        <em class="dan yellow">双</em></td>
                    </tr>
                    <tr>
                    <td>20180916015</td>
                    <td>
                        <span class="numbers">1,5,6</span></td>
                    <td>12</td>
                    <td>
                        <em class="size blue">大</em>
                        <em class="dan yellow">双</em></td>
                    </tr>
                    <tr>
                    <td>20180916014</td>
                    <td>
                        <span class="numbers">1,3,6</span></td>
                    <td>10</td>
                    <td>
                        <em class="size yellow">小</em>
                        <em class="dan yellow">双</em></td>
                    </tr>
                    <tr>
                    <td>20180916013</td>
                    <td>
                        <span class="numbers">1,5,6</span></td>
                    <td>12</td>
                    <td>
                        <em class="size blue">大</em>
                        <em class="dan yellow">双</em></td>
                    </tr>
                    <tr>
                    <td>20180916012</td>
                    <td>
                        <span class="numbers">1,1,2</span></td>
                    <td>4</td>
                    <td>
                        <em class="size yellow">小</em>
                        <em class="dan yellow">双</em></td>
                    </tr>
                    <tr>
                    <td>20180916011</td>
                    <td>
                        <span class="numbers">1,5,6</span></td>
                    <td>12</td>
                    <td>
                        <em class="size blue">大</em>
                        <em class="dan yellow">双</em></td>
                    </tr>
                    <tr>
                    <td>20180916010</td>
                    <td>
                        <span class="numbers">2,5,6</span></td>
                    <td>13</td>
                    <td>
                        <em class="size blue">大</em>
                        <em class="dan blue">单</em></td>
                    </tr>
                    <tr>
                    <td>20180916009</td>
                    <td>
                        <span class="numbers">1,5,6</span></td>
                    <td>12</td>
                    <td>
                        <em class="size blue">大</em>
                        <em class="dan yellow">双</em></td>
                    </tr>
                </tbody>
            </table>
            <!--我的投注-->
            <div class="title">
                <span>我的投注</span>
            </div>
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ty_table_gameBet curr">
                <thead>
                    <tr>
                        <th>期号</th>
                        <th>投注内容</th>
                        <th>奖金</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>20180928039</td>
                        <td>大</td>
                        <td>未开奖</td>
                    </tr>
                </tbody>
            </table>
        </div>
        
    </div>
</template>

<script>
import countTime from "@/components/game/countTime";
import lotteryHistory from "@/components/game/lotteryHistory";
import clientSide from "@/components/game/clientSide";
import {Menu,MenuItem,Icon,Badge,Carousel,CarouselItem,Button,Row,Col,Input,Modal} from 'iView'
export default {
    name:"kuaisan",
    data(){
        return {
            arr:[
                {ntr:"大",odds:"1.820",num:null},
                {ntr:"大",odds:"1.820",num:null},
                {ntr:"大",odds:"1.820",num:null},
                {ntr:"大",odds:"1.820",num:null},
                {ntr:"大",odds:"1.820",num:null},
                {ntr:"大",odds:"1.820",num:null},
                {ntr:"大",odds:"1.820",num:null},
                {ntr:"大",odds:"1.820",num:null},
                {ntr:"大",odds:"1.820",num:null},
                {ntr:"大",odds:"1.820",num:null},
                {ntr:"大",odds:"1.820",num:null},
                {ntr:"大",odds:"1.820",num:null},
                {ntr:"大",odds:"1.820",num:null},
                ],
            manyCtrl:[10,50,100,500,1000,5000,10000],
            sumMany:null,//投注预设金额
            number:true,
            modBet:false,//模态框下注确定
            total:0,//页面下注总额
        }
    },
    components:{
        countTime,
        lotteryHistory,
        clientSide,
        Row,
        Col,
        Input,
        Button,
        Modal
    },
    methods:{
        //监控单个更改
        inputFunc:function (e) {
            console.log(e);
        },
        //预设金额
        changeSum:function(num){
            if(this.sumMany == num){
                this.sumMany = null;
            }else{
                this.sumMany = num;
            }
            
        },
        //设置值
        setValue:function(attr,value){
            let _this = this;
            if(typeof(attr)=="string"){
                _this[attr] = value;
            }else if(typeof(attr)=="object"){
                attr = value;
            }
        },
        //点击设置下注金额
        payNum:function(index){
            if(this.sumMany){
                this.arr[index].num = this.sumMany;
            }
            
        },
        //立即下注遍历下注项目与展示
        addBet(){
            //
            let total = 0;//下注总金额
            let betArr = [];//下注的选项数组
            let _this = this;
            for(let i = 0;i<this.arr.length;i++){
                if(this.arr[i].num){//遍历被下注的选项
                    total+=this.arr[i].num;
                    betArr.push(this.arr[i]);
                }
            }
            if(total==0){//没有下注
                this.$Message.info('请先购买');
            }else{
                this.modBet = true;//显示确认下注
                this.total = total;
            }
            

        },
        //确认下注
        ok () {
            this.$Message.info('下注成功');
            
        },
        cancel () {
            this.$Message.info('取消下注');
        }

    },
    created(){

    }
}
</script>
<style scoped>
.w{width: 100%;}
/*添加投注*/
.addOrderBox{
    height: 100px;
}
.addOrderBox button{
    float: right;
    margin: 30px 0;
}
/*金额控制*/
.sum-ctrl .sum-title{
    height: 36px;
    background: url(http://119.28.54.66:9031/themes/simpleboot3/public/assets/game/images/unit_bg.jpg) repeat-x;
}
.sum-ctrl .sum-title ul li {
    border: none;
    background: url(http://119.28.54.66:9031/themes/simpleboot3/public/assets/game/images/unit_hover.jpg) repeat-x;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    float: left;
    line-height: 36px;
    padding: 0 10px;
    position: relative;
}
.sun-con {
    overflow: hidden;
    padding-top:15px;
    height: 60px;
    margin-left: 15px;
}
/*投注列表*/
.bet{
    text-align: center;
}
.bet .rb-line{
    border-right: 1px solid #F0AD4E;
    border-bottom: 1px solid #F0AD4E;
}
.s_col_20{
    width: 20%;
}
.td {
    display: block;
    height: 35px;
    line-height: 35px;
    float: left;
    flex: 0 0 auto;
}
.bet-list-tit{
    background-color: #FF9726;
    color: #fff;
    height: 40px;
    line-height: 40px;
    font-weight: bold;
}
/*左侧投注功能*/
.betTitle {
    position: relative;
    padding: 15px;
    overflow-y: hidden;
    overflow-x: auto;
}
.betTitle:before {
    content: '';
    clear: both;
}
.betTitle .betLogo {
    width: 310px;
    margin-right: 10px;
    text-align: center;
}

.betTitle .announced, .betTitle .betLogo, .betTitle .countdown {
    background: url(https://066981.com/themes/simpleboot3/public/assets/images/betBg.png);
    float: left;
    height: 140px;
    margin-right: 10px;
}
.betTitle .betLogo h2 {
    font-size: 24px;
}
.betTitle .announced .announcedTitle, .betTitle .betLogo h2, .betTitle .time .timeTitle {
    text-align: center;
    margin: 15px 0;
    font-size: 14px;
    color: #333;
    font-weight: 700;
}
.betTitle .betLogo .game-logo {
    display: inline-block;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    padding: 4px;
    position: relative;
    margin-left: auto;
    top: -3px;
    background-size: contain;
}
.icon_js_ks {
    background: url(http://119.28.54.66:9031/themes/simpleboot3/public/assets/game/images/nsc/warp/icon/k3.png) no-repeat;
}
.betTitle .betLogo .game-logo:before {
    content: "";
    position: absolute;
    display: block;
    height: 1px;
    width: 36px;
    box-shadow: 0 0 10px 2px #b7a4a4;
    background: #dac9c9;
    z-index: 1;
    left: 16px;
    bottom: -8px;
}
.betTitle .announced {
    width: 284px;
    text-align: center;
    position: relative;
}
.betTitle .announced .announced-tab {
    position: absolute;
    height: 100%;
    right: -15px;
    bottom: 0;
    z-index: 11;
    width: 30px;
    word-break: break-all;
    background: #333;
}
.betTitle .announced .announced-tab .tab-item.active {
    background: #f00;
}
.betTitle .announced .announced-tab div {
    text-align: center;
    color: #fff;
    font-size: 12px;
    padding: 0 8px;
    line-height: 1;
}
.betTitle .announced .announced-tab .tab-item span {
    display: table-cell;
    width: 30px;
    height: 70px;
    vertical-align: middle;
    cursor: default;
}
.betTitle .announcedTitle b, .betTitle .timeTitle b {
    color: red;
    margin: 0 5px;
}
.betTitle .his-wrapper {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 10;
    background: url(https://066981.com/themes/simpleboot3/public/assets/images/betBg.png);
}
.betTitle .his-list {
    padding: 5px 20px 5px 10px;
}
.betTitle .his-item {
    margin-bottom: 5px;
    text-align: left;
}
.betTitle .his-item .ball {
    font-size: 12px;
    font-style: normal;
    width: 1.8em;
    height: 1.8em;
    line-height: 1.8em;
    text-align: center;
    display: inline-block;
    margin-left: 10px;
    background-color: #666;
    border-radius: 50%;
    color: #fff;
}
.game-main{
    width:980px;
    position: relative;
    box-shadow: none;
    background: #fff;
}
/*右侧开奖情况*/
.resultList{
    width: 220px;
    background: #eee;
}
.resultList .title span, .resultList2 .title span {
    border-bottom: 1px solid #ddd;
    background: #455467;
    color: #fff;
    border-radius: 3px;
    display: inline-block;
    margin: 15px 0 6px 8px;
    text-align: center;
    height: 26px;
    line-height: 26px;
    font-weight: 100;
    font-size: 12px;
    padding: 0 6px;
}
.resultList .more, .resultList2 .more {
    display: inline-block;
    width: 140px;
    height: 26px;
    text-align: right;
}
table {
    border-collapse: collapse;
    border-spacing: 0;
}
.resultList table, .resultList2 table {
    border: 1px solid #eee;
}
.resultList table th, .resultList2 table th {
    background: #f2f4f7;
    height: 28px;
    line-height: 28px;
    text-align: center;
    font-weight: 400;
    color: #666;
    border-bottom: 1px solid #ddd;
}
.resultList td, .resultList2 td {
    height: 24px;
    line-height: 24px;
    text-align: center;
    color: #666;
    background: #fff;
    border-right: 1px dotted #ebebeb;
    border-bottom: 1px dashed #ebebeb;
}
.resultList td .numbers {
    color: #ff9600;
}
.resultList td .blue {
    background: #5691d7!important;
}
.resultList td .yellow {
    background: #ff9726!important;
}
.resultList td .size {
    width: 18px;
    height: 18px;
    display: inline-block;
    border-radius: 2px;
    color: #fff;
    vertical-align: middle;
    line-height: 18px;
    margin: 0 2px;
}
.resultList td .dan {
    width: 18px;
    height: 18px;
    display: inline-block;
    border-radius: 2px;
    color: #fff;
    vertical-align: middle;
    line-height: 18px;
}
</style>
